<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="../../css/common/reset.css">
    <link rel="stylesheet" href="../../css/readMore.css">
</head>

<body style="background: #fff;">
    <!--列表 class="wechatPopup "-->
    <form action="?" class="layui-form">
        <ul>
            <li>
                <p>您确定删除吗？</p>
            </li>
            <li>
                <input type="submit" value="提交" class="btn sureBtn" lay-submit="" lay-filter="delPlanInfo">
                <input type="button" value="返回" class="btn editBtn" id="closeIframe">
            </li>
        </ul>
    </form>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/dataRequest.js"></script>
    <script>
        var mid = $.cookie('id');
        if (mid == null || mid == "" || !mid || mid == undefined) {
            window.location.href = "/login.html";
        }
        function child(obj) {
            console.log('接收删除ID');//获取父界面的传值
            console.log(obj);//获取父界面的传值
            console.log('接收删除ID');//获取父界面的传值
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            //关闭iframe
            $('#closeIframe').click(function () {
                parent.layer.close(index);
            });
            layui.use(['jquery', 'form'], function () {
                $ = layui.jquery;
                form = layui.form;
                form.on('submit(delPlanInfo)', function (data) {
                    $.ajax({
                        type: "DELETE",
                        url: BASE_URL + MAP_URL + "plan/" + obj,
                        //data:{planId: planId},
                        dataType: 'json',
                        success: function (data) {
                            layer.msg("删除成功");
                            setTimeout(function () {
                                parent.layer.close(index);//关闭弹出层
                                parent.location.reload();//更新父级页面（提示：如果需要跳转到其它页面见下文）
                            }, 2000);
                            // _this.parent("td").parent("tr").remove();
                        },
                        error: function (XMLHttpRequest, textStatus, errorThrown) { }
                    });
                    //防止页面跳转
                    return false;
                });
            });
        }
    </script>
</body>

</html>